#include "Demo_LinesDemoHelper.h"

#include <vector>
#include <string>

#include <highgui.h>

using namespace std;

Demo_LinesDemoHelper::Demo_LinesDemoHelper(void) {
	im = NULL;
}

Demo_LinesDemoHelper::~Demo_LinesDemoHelper(void) {
}

void Demo_LinesDemoHelper::setUp() {
	string filename = "..\\..\\..\\data\\kitchen.jpg";
	im = cvLoadImage(filename.c_str());
	if (im == NULL) {
		throw "can not load kitchen image!";
	}
}

void Demo_LinesDemoHelper::tearDown() {
	if (im != NULL) cvReleaseImage(&im);
}

void Demo_LinesDemoHelper::demo_demoLine() {

	Line line(cvPoint2D32f(100, 100), cvPoint2D32f(200, 300));
	linesDemoHelper.demoLine(im, line);
	
}

void Demo_LinesDemoHelper::demo_demoLines() {

	vector<Line> lines;
	lines.push_back(Line(cvPoint2D32f(100, 100), cvPoint2D32f(100, 200)));
	lines.push_back(Line(cvPoint2D32f(100, 100), cvPoint2D32f(200, 100)));

	linesDemoHelper.demoLines(im, lines);
}
